import React, {Component} from 'react';
import { StyleSheet, 
  Text, 
  View, 
  WebView ,
  Dimensions,
  FlatList
} from 'react-native';
//import { WebView } from 'react-native-webview';
import BackButton from '@/components/BackButton'
import Loading from '@/components/Loading'
export default class NewsDetail extends Component{
  static navigationOptions = ({ navigation }) =>{
    return{
      title:'详情',
      headerRight:(<View/>),
      headerLeft:<BackButton navigation = {navigation}/>
    }
  };
  constructor(props){
    super(props)
  }
  _renderLoading(){
    return(<Loading/>)
  }
  render(){
    return(
      <View style={{flex:1}}>
        <WebView
          renderLoading={()=> this._renderLoading()}
          startInLoadingState={true}
          onLoadEnd={()=>this.setState({loading: false})}
          source={{uri:this.props.navigation.getParam('url')}}
        />
      </View>
      
    )
  }
}